package com.paranoid.flashcard.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

import com.paranoid.flashcard.R;
import com.paranoid.flashcard.dao.FlashcardDao;

public class DashboardActivity extends Activity {
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dashboard);
		// TODO: change the initialization of the dao
		FlashcardDao dao = FlashcardDao.getInstance(this);
//		dao.loadTestData();
		ImageButton myCards = (ImageButton)findViewById(R.id.studyButton);
		myCards.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent i = new Intent(DashboardActivity.this, DeckListActivity.class);
				DashboardActivity.this.startActivity(i);
			}
		});

		ImageButton importCards = (ImageButton)findViewById(R.id.featuredButton);
		importCards.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent i = new Intent(DashboardActivity.this, FeaturedActivity.class);
				DashboardActivity.this.startActivity(i);
			}
		});
		
		ImageButton library = (ImageButton)findViewById(R.id.libraryButton);
		library.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(DashboardActivity.this, "Coming soon", Toast.LENGTH_SHORT).show();
			}
		});
		
		ImageButton search = (ImageButton)findViewById(R.id.searchButton);
		search.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(DashboardActivity.this, "Coming soon", Toast.LENGTH_SHORT).show();
			}
		});

		ImageButton account = (ImageButton)findViewById(R.id.accountButton);
		account.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(DashboardActivity.this, "Coming soon", Toast.LENGTH_SHORT).show();
			}
		});

		ImageButton settings = (ImageButton)findViewById(R.id.settingsButton);
		settings.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				Toast.makeText(DashboardActivity.this, "Coming soon", Toast.LENGTH_SHORT).show();
			}
		});
	}

}
